package com.weipai.education.dao;

import com.weipai.education.model.*;

import javax.validation.constraints.NotNull;
import java.util.List;
import java.util.Map;

/**
 * @Author: 曹朋飞
 * @Date: 2018/12/13 17:26
 */
public interface InventoryDao {
    List<Map<String,Object>> list(Integer start, Integer size, String spuNumber, String key, String userId);

    Integer listAmount(String spuNumber, String key, String userId);
    
    InventoryDetail getInventoryDetail(String userId, String productId, String goodsBarCode);

    Inventory getInventory(String userId, String productId);

    int updateByPrimaryKeySelective(Inventory inventory);
    
    void batchDeleteInventoryDetailById(List<Integer> inventoryDetailId);

    List<Map<String,Integer>> selectDetailPeoduct(Integer productId,Integer userId,Integer totalNumber);

    int saveInventoryIn(InventoryIn in);

    int saveInventoryInDetail(InventoryInDetail inventoryInDetail);

    int saveInventoryInDetailByNobarcode(InventoryInDetail inventoryInDetail);

    int saveInventoryOut(InventoryOut out);

    int saveInventoryOutDetail(InventoryOutDetail inventoryOutDetail);

    List<Map<String,Object>> inventoryOutList(Integer start, Integer size, String goodsBarCode, String spuNumber, 
                                              String startTime, String endTime, String userId);

    Integer inventoryOutListAmount(String goodsBarCode, String spuNumber, String startTime, 
                                   String endTime, String userId);

    List<Map<String,Object>> inventoryInList(Integer start, Integer size, String goodsBarCode, String spuNumber, 
                                             String startTime, String endTime, String userId);

    Integer inventoryInListAmount(String goodsBarCode, String spuNumber, String startTime, String endTime, 
                                  String userId);

    InventoryOutDetail getInventoryOutDetail(String purchaseNumber, String userId,String productId);

    List<Map<String,Object>> getAllInventoryOutDetail(String purchaseNumber, Integer userId,Integer productId);

    InventoryInDetail getInventoryOutDetailByisPrice(String purchaseNumber);

    int saveInventoryDetail(InventoryDetail inventoryDetail);

    int saveInventory(Inventory inventory);

    List<Map<String,Object>> getUserGoodsBar(Integer productId, String userId);

    int getSaleNumber(String userId);

    List<Map<String, Object>> getSaleNumberWeek(String userId);

    PurchaseDetail getPurchaseDetail(@NotNull(message = "产品id不能为空") Integer productId);

    InventoryInDetail getInventoryOutDetailByisDamage(String inOrderNumber);
}
